<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/infotable.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/datatable.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/api.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.dataTables.chs.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
    
    var urlPrefix = "${pageContext.request.contextPath}/api/";
    var newsNoticeId = "<s:property value='newsNoticeId' />";
    var newsNoticeAPI = new NewsNoticeAPI({urlPrefix : urlPrefix});
    
    if (newsNoticeId == "") {
        window.location.href = "${pageContext.request.contextPath}/forward/home";
    }
    
    newsNoticeAPI.detail({
		onSuccess : function(data) {
		    if (data.result) {
		        $('title').text(data.news_notice.title);
		        $('#title_label').text(data.news_notice.category_name);
		        $('#lbl_news_notice_title').text(data.news_notice.title);
		        $('#news_notice_body').html(data.news_notice.body)
		    } else {
		        window.location.href = "${pageContext.request.contextPath}/forward/home";
		    }
		},
		onAPIError : function(status, errors) {
		    window.location.href = "${pageContext.request.contextPath}/forward/home";
		},
		onServerError : function(jqXHR, textStatus, errorThrown) {
		    window.location.href = "${pageContext.request.contextPath}/forward/home";
		}
	},
	{
		param: JSON.stringify({
		    news_notice_id: newsNoticeId
		})
	});
});
</script>
</head>
<body>
  <div style="text-align: center;" align="center">
    <jsp:include page="top.jsp" />
    <div id="content" style="width: 1000px; margin: 0 auto; margin-top: 10px; border: 1px solid #eee;">
      <div style="width: 990px; height: 30px; border-bottom: 1px solid #eee; text-align: left; padding-top: 5px; padding-left: 10px;">
        <label id="title_label" class="title_label" style="margin-top: 5px;"></label>
        <label style="font-size: 13px; height: 30px; vertical-align: middle; font-weight: bold; margin-top: 5px;">&gt;</label>
        <label id="lbl_news_notice_title" style="font-size: 13px; height: 30px; vertical-align: middle; font-weight: bold; margin-top: 5px;"></label>
      </div>
      <div id="news_notice_body" style="width: 990px; margin: 0 auto; text-align: left; font-size: 14px;"></div>
    </div>
    <div id="footer"><s:text name="copyright" /></div>
  </div>
</body>
</html>